<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommoditysTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('commoditys', function (Blueprint $table) {
          $table->charset = 'utf8';
          $table->collation = 'utf8_general_ci';
          $table->increments('id',11);
          $table->string('name',255)->comment("商品名称");
          $table->string('price',255)->comment("商品价格");
          $table->string('img',255)->comment("商品图片");
          $table->text('introduce')->comment("商品简述");
          $table->string('stock')->comment("商品库存量");
          $table->string('stock',40)->comment("商品库存量");
          $table->string('sales_volume',40)->comment("商品销量");
          $table->string('phone_number',255)->comment("电话");
          $table->integer('category_id')->nullable(true)->comment("商品所属类别");
          $table->char('is_hot',4)->default('0')->comment("0不是热销商品，1是热销商品");
          $table->char('is_on_shelf',4)->default('0')->comment("0不上架，1上架");
          $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('commoditys');
    }
}
